package me.flyray.bsin.server.impl;

import me.flyray.bsin.facade.service.WorkflowService;
import me.flyray.bsin.server.utils.BsinInvoke;
import me.flyray.bsin.server.utils.RespBodyHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class WorkflowServiceImpl implements WorkflowService {

    /**
     * 流程定义部署
     * @param reParam
     * @return
     */
    @Override
    public Map<String,Object>  deploy(Map<String,Object> reParam){
        BsinInvoke.genericInvoke("BsinRepositoryService","importProcessDefinition",null);
        return RespBodyHandler.RespBodyDto();
    }

    /**
     * 启动流程实例
     * @param requestMap（流程定义id）
     * @return
     */
    @Override
    public Map<String, Object> startMedicalAdviceProcessInstance(Map<String, Object> requestMap) {
        BsinInvoke.genericInvoke("BsinRuntimeService","startProcessInstanceByProcessDefinitionId",requestMap);
        return RespBodyHandler.RespBodyDto();
    }


}
